#include <iostream>
#include <queue>
#include <vector>

using namespace std;
typedef long long ll;

int main()
{
	ll n, k, sum = 0;
	cin >> n >> k;
	vector<ll> vt(n);
	priority_queue<ll> qu;
	for (int i = 0; i < n; ++i)
	{
		scanf("%lld", &vt[i]);
		if ((vt[i] & 1) == 0)
			qu.push(vt[i]);
		sum += vt[i];
	}
	while (qu.size() && k--)
	{
		if ((qu.top() & 1) == 0)
		{
			ll tmp = qu.top();
			qu.pop();
			if (((tmp / 2) & 1) == 0)
				qu.push(tmp / 2);
			sum -= tmp / 2;
		}
	}
	cout << sum << endl;
	return 0;
}